package yunwo.cn.yzstation.other;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.HorizontalScrollView;

/**
 * Created by lao on 2017/8/29.
 */

public class MyHorizontalscroll extends HorizontalScrollView {
    public MyHorizontalscroll(Context context) {
        super(context);
    }

    public MyHorizontalscroll(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyHorizontalscroll(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }




    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {

        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        int action = ev.getAction();
        Log.d("ccccc", "actionLLLLLLLLLLLL"+action);
        if (ev.getAction() == MotionEvent.ACTION_MOVE) {
//            return true;
        }

        return false;
    }
    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        switch (ev.getAction()) {
            case MotionEvent.ACTION_DOWN:
                Log.d("ccccc", "ACTION_DOWN");
                requestDisallowInterceptTouchEvent(true);
//                return true;
                break;
            case MotionEvent.ACTION_MOVE:
            Log.d("ccccc", "ACTION_MOVE");
            requestDisallowInterceptTouchEvent(true);
//                return false;
            break;

        }
        return super.onTouchEvent(ev);
    }

}
